﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestConsoleReport
{
    public partial class Claim
    {
        public int Id { get; set; }
        public string EntryOwner { get; set; }
        public DateTime EntryDateTime { get; set; }

        public DateTime ClaimDate { get; set; }
        public DateTime? StartWorkTime { get; set; }
        public DateTime? EndWorkTime { get; set; }
        public DateTime? StartOverTime { get; set; }
        public DateTime? EndOverTime { get; set; }

        public decimal? OT1_5 { get; set; }
        public decimal? OT2_0 { get; set; }
        public bool? PH { get; set; }
        public bool? RD4 { get; set; }
        public bool? RD8 { get; set; }

        public decimal? AlwMeal { get; set; }
        public decimal? AlwShft { get; set; }
        public string ShiftType { get; set; }
        public string Remark { get; set; }

        public byte? Status { get; set; }
        public char? Exported { get; set; }
        public char? _Action { get; set; }

        public string CheckerId { get; set; }
        public DateTime? SubmissionDate { get; set; }

        public DateTime? RejectionDate { get; set; }
        public string RejectorId { get; set; }
        public string RejectReason { get; set; }

        public DateTime? ApprovedDate { get; set; }
        public string ApproverId { get; set; }

        public string TotalOTHours
        {
            get
            {
                if ((StartOverTime.HasValue) && (EndOverTime.HasValue) && (StartOverTime.Value < EndOverTime.Value))
                {
                    return (EndOverTime.Value - StartOverTime.Value).TotalHours.ToString();
                }
                else
                {
                    return string.Empty;
                }

            }
        }

    }
}
